package com.bolt.report.definition;


public enum DataSetType {

    SQL(0),

    API(1),

    JSON(2),

    SPRING(3);

    Integer code;

    DataSetType(Integer code) {
        this.code = code;
    }

    public static DataSetType toType(Integer code) {
        for (DataSetType typeEnum : DataSetType.values()) {
            if (typeEnum.code.equals(code)) {
                return typeEnum;
            }
        }
        return null;
    }
}